<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zh-tw">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Proactive</title>
	<!-- favicon -->
	<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico">
	<link rel="Bookmark" href="images/favicon.ico" type="../image/x-icon"/>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">

    <!-- Add custom CSS here -->
    <link href="css/modern-business.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="css/egroupstyle.css" rel="stylesheet">
</head>

<body>

    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!-- You'll want to use a responsive image option so this logo looks good on devices - I recommend using something like retina.js (do a quick Google search for it and you'll find it) -->
                <a class="navbar-brand" href="manageCardTemplate">Proactive</a>
            </div>
            <div>
                <ul class="nav navbar-nav">
                    <li class="dropdown"><a href="##"><i class="fa fa-user"></i>&nbsp;Hi,${loginManager.name} <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="logout">登出</a>
                            </li>
                        </ul>
                    </li>
                </ul>  
            </div>

            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="manageCardTemplate">活動管理</a>
                    </li>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>


    <div class="container tablestyle">

        <div class="row">

            <div class="col-lg-12">
                <h2 class="page-header">卡片樣式管理
                </h2>
                <a href="addCardTemplateCont"><button type="button" class="btn btn-success btn-sm">
                  <span class="glyphicon glyphicon-plus"></span> 新增卡片樣式
                </button></a>
                <a href="modiActivityCont"><button type="button" class="btn btn-success btn-sm">
                      <span class="glyphicon glyphicon-pencil"></span> 活動編輯
                    </button></a>           
                <br /><br />

                <div class="bs-component">
                  <table class="table table-striped table-hover table-bordered">
                    <thead>
                      <tr>
                        <th>標題</th>              
                        <th width="80">編輯</th>
                        <th width="80">刪除</th>
                      </tr>
                    </thead>
                    <tbody>
                    	<c:forEach items="${cardTemList}" var="cardTemplate">
                    		<tr>
                    			<td>${cardTemplate.title}</td>
	                    		<td>
	                    			<a href="modiCardTemplateCont?id=${cardTemplate.id}">
	                    			<button class="btn btn-xs btn-default">
	                            		<span class="glyphicon glyphicon-pencil"></span>  編輯
	                        		</button>
	                        		</a>
	                    		</td>
	                    		<td>	                    			
	                    			<button id="del" class="btn btn-xs btn-default deleteBtn" data-id="${cardTemplate.id}">
	                            		<span class="glyphicon glyphicon-trash"></span>  刪除
	                        		</button>
	                    		</td>
                    		</tr>
                    	</c:forEach>                
                    </tbody>
                  </table> 
                 
            
                </div><!-- /example -->
            </div>
            


        </div>
        <div class="row">
        <div class="col-sm-6"></div>
        <div class="col-sm-6 text-right">

			<div class="page clearfix">
				<ul>
				<c:forEach items="${page.pagerList}" var="pager">
					<li class="${pager.indexClass}"><a href="${pager.url}">${pager.index}</a></li>
				</c:forEach>			
				</ul>
			</div><!-- page -->             
        </div>
        </div>        
    </div>


    <div class="container">

        <hr>

        <footer>
            <div class="row">
                <div class="col-lg-12">
                    <p>Copyright &copy; Company 2013</p>
                </div>
            </div>
        </footer>

    </div>
    <!-- /.container -->
	<form action="delCardTemplate" method="post" id="delForm">
		<input type="hidden" name="id" id="id">
	</form>
	

    <!-- JavaScript -->
    <script src="js/jquery-1.10.2.js"></script>
    <script src="js/bootstrap.js"></script>
    <script src="js/modern-business.js"></script>
	
	<script type="text/javascript">
	$(".deleteBtn").click(function(){
		var r = confirm("是否要刪除");
		if(r == true){
			var id = $(this).attr("data-id");
			$("#id").val(id);
			$("#delForm").submit(); 
		}
		else{
			return false;
		}
	});
	</script>
</body>

</html>